//
//  ListCollectionViewCell.m
//  Qyer
//
//  Created by 赵宇 on 15/9/15.
//  Copyright (c) 2015年 赵宇. All rights reserved.
//

#import "ListCollectionViewCell.h"
#import "BaseHeader.h"
@implementation ListCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {

        self.photoView = [[UIImageView alloc]initWithFrame:self.contentView.frame];
        [self.contentView addSubview:self.photoView];
        
        UIView *back = [[UIView alloc]initWithFrame:self.photoView.frame];
        back.backgroundColor = [UIColor colorWithRed:0. green:0. blue:0. alpha:.3];
        [self.photoView addSubview:back];
        self.cnnameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.photoView.frame.size.height/3, self.contentView.frame.size.width, 20)];
        self.cnnameLabel.textColor = [UIColor whiteColor];
        self.cnnameLabel.font = [UIFont boldSystemFontOfSize:18.];
        self.cnnameLabel.textAlignment = YES;
        [self.contentView addSubview:self.cnnameLabel];
        
        self.ennameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.photoView.frame.size.height/3+20, self.contentView.frame.size.width, 20)];
        self.ennameLabel.font = [UIFont systemFontOfSize:13.];
        self.ennameLabel.textAlignment = YES;
        self.ennameLabel.textColor = [UIColor whiteColor];
        [self.contentView addSubview:self.ennameLabel];
    }
    return self;
}
-(void)setUpWithModel:(hot_countryModel *)model
{
    NSURL *url = [NSURL URLWithString:model.photo];
    [self.photoView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanweiPic"]];
    self.cnnameLabel.text = model.cnname;
    self.ennameLabel.text = model.enname;
    
}
@end
